<template>
    <div class="section-wrap hide-register">
        <div class="form-section">
            <div class="form-item form-item-style1"
                 v-if="userInfo.departsir !== '1'">
                <div class="label-title">
                    <label>被检查单位</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <div class="right-select"
                     v-if="userInfo.departsir!=1"
                     @click="companyPropShow = true">
                    <p>
                        {{hiddenmeta.deptName?hiddenmeta.deptName:"请选择"}}
                    </p>
                    <i class="iconfont icon-jinru rightmsg"></i>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>隐患类别</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <div class="right-select"
                     @click="hideTypePropShow = true">
                    <p>
                        {{hiddenmeta.category?hiddenmeta.category:"请选择"}}
                    </p>
                    <i class="iconfont icon-jinru rightmsg"></i>
                </div>
            </div>
            <div class="form-item form-item-style2">
                <div class="label-title space-between">
                    <div class="space-between">
                        <label>隐患描述</label>
                        <i class="iconfont icon-required"></i>
                    </div>
                    <a @click="toselectmsg">选择隐患</a>
                </div>
                <div>
                    <textarea @change="hidenewfirst(hiddenmeta.description)"
                              placeholder="请输入隐患描述（自行换行）"
                              v-model="hiddenmeta.description"></textarea>
                </div>
            </div>
            <div class="form-item form-item-style2">
                <div class="label-title space-between">
                    <div class="space-between">
                        <label>整改前照片</label>
                        <i v-if="userInfo.departsir == '1'"
                           class="iconfont icon-required"></i>
                    </div>
                    <span>当前共{{hiddenmeta.uploadImgs.length}}张照片</span>
                </div>
                <div class="upload-wrap">
                    <upload v-if="showUpload"
                            @setFormData="setFormData"
                            :hasWatermark="true"
                            :uploadImgss="hiddenmeta.uploadImgs"
                            :images="hiddenmeta.images"
                            :newBlobList="hiddenmeta.newBlobList"></upload>
                </div>
            </div>
            <div class="form-item form-item-style2">
                <div class="label-title">
                    <label>整改措施</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <div>
                    <textarea placeholder="请输入隐患措施（自行换行）"
                              @change="hidenewtwo(hiddenmeta.measure)"
                              v-model="hiddenmeta.measure"></textarea>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>隐患级别</label>
                </div>
                <group>
                    <popup-picker :data="list1"
                                  v-model="hiddenmeta.hdLevel"
                                  @on-change="changeleve"
                                  placeholder="请选择"></popup-picker>
                </group>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>整改开始时间</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <group>
                    <datetime :start-date="showDate"
                              v-model="hiddenmeta.resolveStartTime"
                              @on-change="newchange"></datetime>
                </group>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>整改结束时间</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <group>
                    <datetime :start-date="showDateEnd"
                              v-model="hiddenmeta.resolveEndTime"
                              @on-change="newchangeend"></datetime>
                </group>
            </div>

            <!--*************子公司或者公司************-->
            <div v-if="userInfo.departsir !== '1'">
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>所属单位</label>
                    </div>
                    <div class="newcompanyList"
                         style="width: 200px;height: 54px;overflow: hidden;">
                        {{hiddenmeta.deptName}}
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>被检查单位负责人</label>
                    </div>
                    <div class="newcompanyList">
                        {{hiddenmeta.projectDutyPerson}}
                    </div>
                </div>
            </div>
            <div class="form-item form-item-style2">
                <div class="label-title space-between">
                    <div class="space-between">
                        <label>隐患部位</label>
                    </div>
                    <span v-if="userInfo.departsir==1"
                          @click="newposition">选择隐患</span>
                </div>
                <div>
                    <textarea @change="changeResolveArea(hiddenmeta.resolveArea)"
                              placeholder="请输入隐患描述（自行换行）"
                              v-model="hiddenmeta.resolveArea"
                              v-if="userInfo.departsir==1&&(hiddenmeta.resolveArea=='无'||manualArea)"
                              @keydown="resolveAreaKeyDown"></textarea>
                    <p class="textarea"
                       v-else>{{hiddenmeta.resolveArea?hiddenmeta.resolveArea:"无"}}</p>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>整改责任人</label>
                    <i v-if="userInfo.departsir != '0' && userInfo.departsir != '11'"
                       class="iconfont icon-required"></i>
                </div>
                <div class="right-select"
                     v-if="hiddenmeta.resolveArea=='无'||manualArea"
                     @click="newperson">
                    <p>
                        {{hiddenmeta.resolveAreaDutyPerson?hiddenmeta.resolveAreaDutyPerson:"请选择"}}
                        <i class="iconfont icon-jinru rightmsg"></i>
                    </p>
                </div>
                <div class="right-select"
                     v-if="hiddenmeta.resolveArea!='无'&&!manualArea">
                    <p>
                        {{hiddenmeta.resolveAreaDutyPerson?hiddenmeta.resolveAreaDutyPerson:""}}
                    </p>
                </div>
            </div>
            <div v-if="hiddenmeta.resolveArea!='无'&&!manualArea">
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>整改单位</label>
                    </div>
                    <div class="right-select"
                         @click="newcompany">
                        {{hiddenmeta.ResolveDeptName?hiddenmeta.ResolveDeptName:"请选择"}}
                        <i class="iconfont icon-jinru rightmsg"></i>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>整改执行人</label>
                    </div>
                    <div class="newcompanyList right-select">
                        <p>
                            {{hiddenmeta.ResolveDutyPersonName}}
                        </p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>整改班组</label>
                    </div>
                    <div class="right-select"
                         @click="newclass">
                        <p>
                            {{hiddenmeta.ResolveGroup?hiddenmeta.ResolveGroup:"请选择"}}
                            <i class="iconfont icon-jinru rightmsg"></i>
                        </p>
                    </div>

                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>整改班组负责人</label>
                    </div>
                    <div class="newcompanyList right-select">
                        <p>
                            {{hiddenmeta.ResolveGroupDutyPerson}}
                        </p>
                    </div>
                </div>
            </div>
        </div>
        <!-- <div class="form-section">
            <h3>检查人信息</h3>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>检查单位</label>
                </div>
                <div class="right-select">
                    <p>
                        {{userInfo.deptname}}
                    </p>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>检查人</label>
                </div>
                <div>
                    <input type="text"
                           :value="userInfo.username">
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>电话</label>
                </div>
                <div>
                    <input type="text"
                           :value="userInfo.tel">
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>检查时间</label>
                </div>
                <div>
                    <p>{{hiddenmeta.checkTime}}</p>
                </div>
            </div>
        </div> -->
        <div class="form-section">
            <h3>通知单</h3>
            <div class="form-item form-item-style1">
                <div class="label-title label-title1">
                    <label>生成隐患整改通知单</label>
                </div>
                <div class="select-section">
                    <div :class="{'active':hiddenmeta.flag1}"
                         @click="hiddenmeta.flag1 = true">
                        是
                    </div>
                    <div :class="{'active':!hiddenmeta.flag1}"
                         @click="hiddenmeta.flag1 = false">
                        否
                    </div>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title label-title1">
                    <label>生成设备停用通知单</label>
                </div>
                <div class="select-section">
                    <div :class="{'active':hiddenmeta.flag2}"
                         @click="hiddenmeta.flag2 = true">
                        是
                    </div>
                    <div :class="{'active':!hiddenmeta.flag2}"
                         @click="hiddenmeta.flag2 = false">
                        否
                    </div>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title label-title1">
                    <label>生成停工通知单</label>
                </div>
                <div class="select-section">
                    <div :class="{'active':hiddenmeta.flag3}"
                         @click="hiddenmeta.flag3 = true">
                        是
                    </div>
                    <div :class="{'active':!hiddenmeta.flag3}"
                         @click="hiddenmeta.flag3 = false">
                        否
                    </div>
                </div>
            </div>
        </div>
        <div class="btns">
            <button @click="tosavemsg">提交</button>
        </div>
        <companyProp :companyPropShow="companyPropShow"
                     :selectCompany="selectCompany"
                     :selectSlef="false"></companyProp>
        <hideTypeProp :hideTypePropShow="hideTypePropShow"
                      :selectHideType="selectHideType"></hideTypeProp>
        <hideDescribeProp :hideDescribePropShow="hideDescribePropShow"
                          :selectHideDesPerson="selectHideDesPerson"
                          :id="hiddenmeta.categoryId"></hideDescribeProp>
        <selectAreaProp :selectAreaPropShow="selectAreaPropShow"
                        :selectAreaFn="selectAreaFn"
                        :deptId="hiddenmeta.deptId
                        "
                        v-if="userInfo.departsir==1"></selectAreaProp>
        <changeCompanyProp :changeCompanyPropShow="changeCompanyPropShow"
                           :selectCompanyFn="selectCompanyFn"
                           :deptId="hiddenmeta.deptId"></changeCompanyProp>
        <changeTeamProp :changeTeamPropShow="changeTeamPropShow"
                        :selectTeamFn="selectTeamFn"
                        :deptId="hiddenmeta.ResolveDeptId"></changeTeamProp>
        <zgResponsibleProp :zgResponsiblePropShow="zgResponsiblePropShow"
                           :selectResponsibleUserFn="selectResponsibleUserFn"
                           :deptId="hiddenmeta.deptId"></zgResponsibleProp>
        <myMenu ref="myMenu"></myMenu>
    </div>
</template>
<script>
import upload from '@/commonComponents/upload/index'
import hideTypeProp from '@/commonComponents/hideTypeProp' // 隐患类别选择
import hideDescribeProp from '@/commonComponents/hideDescribeProp' // 隐患描述
import selectAreaProp from '@/commonComponents/selectAreaProp' // 区域选择
import changeCompanyProp from '@/commonComponents/changeCompanyProp' //  整改单位
import changeTeamProp from '@/commonComponents/changeTeamProp' //  整改班组
import zgResponsibleProp from '@/commonComponents/zgResponsibleProp' // 整改责任人
import myMenu from '@/commonComponents/menu'
import companyProp from '@/commonComponents/companyProp'
import { XDialog, TransferDom, XHeader, InlineLoading } from 'vux'
export default {
    directives: {
        TransferDom
    },
    name: 'newHideRegister',
    data () {
        return {
            list1: [['一般隐患', '重大隐患']],
            uploadLength: 0, // 图片上传个数
            uploadImgFormData: '', // 图片上传formData对象
            uploadImgs: [],
            images: [],
            newBlobList: [],

            category: '',
            categoryid: '',
            hiddenmeta: {
                'category': '',
                'categoryId': '',
                'checkDeptCode': '',
                'checkDeptId': '',
                'checkDeptName': '',
                'checkPerson': '',
                'checkPersonId': '',
                'checkTime': '',
                'checkWorkId': '', // 检测信息
                'deptId': '',
                'deptName': '',
                'description': '',
                'hdLevel': ['一般隐患'],
                'isApproved': false,
                'isBig': '0',
                'isChecked': false,
                'isResolved': false,
                'isSubmited': false,
                'localId': '',
                'measure': '',
                'measureEdit': false,
                'no': '',
                'problemImgs': '',
                'projectDutyPerson': '',
                'registerUserId': '',
                'resolveArea': '无',
                'resolveAreaDutyPerson': '',
                'resolveAreaDutyPersonId': '',
                'resolveEndTime': '',
                'resolveStartTime': '',
                'tel': '',
                'userId': '',
                'images': [],
                'uploadImgs': [],
                'newBlobList': [],
                'ResolveDeptName': '', // 整改单位
                'ResolveDeptCode': '',
                'ResolveDutyPersonName': '',

                'ResolveGroupId': '',
                'ResolveGroup': '',
                'ResolveGroupDutyPerson': '',
                'ResolveDeptId': '',
                'flag1': false,
                'flag2': false,
                'flag3': false
            },
            backupHiddenmeta: {}, // 初始数据备份
            userInfo: '',
            showDate: '',
            showDateEnd: '',
            hideTypePropShow: false, // 隐患类型弹层
            hideDescribePropShow: false, // 隐患描述弹层
            selectAreaPropShow: false, // 区域描述弹层
            changeCompanyPropShow: false, //  整改单位弹层
            changeTeamPropShow: false, //
            zgResponsiblePropShow: false, // 整改责任人
            companyPropShow: false, // 选择单位弹框
            showUpload: true,
            manualArea: true // 隐患部位是否是手动输入的
        }
    },
    components: {
        upload,
        XDialog,
        XHeader,
        myMenu,
        InlineLoading,
        hideTypeProp,
        hideDescribeProp,
        selectAreaProp,
        changeCompanyProp,
        changeTeamProp,
        zgResponsibleProp,
        companyProp
    },
    created () {
        this.userInfo = JSON.parse(localStorage.userInfo)
        this.hiddenmeta.checkTime = this.getdatenew()
        this.showDate = this.getdatenew()
        if (this.userInfo.departsir === '1') { // 项目层级
            this.hiddenmeta.deptId = this.userInfo.deptid
            this.hiddenmeta.deptName = this.userInfo.deptname
            this.lookcompanylist()
        }
        this.hiddenmeta.resolveStartTime = this.getdatenew()
        this.backupHiddenmeta = JSON.parse(JSON.stringify(this.hiddenmeta))
    },
    activated () {
        this.showUpload = true
        this.$refs.myMenu.flag = false
    },
    methods: {
        toselectmsg () {
            if (!this.hiddenmeta.categoryId) {
                this.$vux.toast.text('请选择隐患类别')
                return false
            }
            // this.$router.push('/selectStandard')
            this.hideDescribePropShow = true
        },
        selectType () {
            this.$router.push({ path: '/searchnew' })
        },
        newposition () {
            this.selectAreaPropShow = true
        },
        newperson () {
            this.zgResponsiblePropShow = true
        },
        newcompany () {
            this.changeCompanyPropShow = true
        },
        newclass () {
            if (!this.hiddenmeta.ResolveDeptId) {
                this.$vux.toast.text('请选择整改单位')
                return false
            }
            this.changeTeamPropShow = true
        },
        hiddleType () { // 获取隐患类别
            let param = {
                'allowPaging': true,
                'business': 'FetchHiddenDangerStandards',
                'data': {
                    'ProjectId': this.userInfo.deptid
                },
                'pageIndex': 0,
                'pageSize': 20,
                'tokenId': this.userInfo.tokenId,
                'userId': this.userInfo.userid
            }
            this.$axiosAjax.getConfigJson(
                param
            ).then(
                (res) => {
                    this.theModel = res.data.data
                }
            )
        },
        hiddlechange () {
            let param = {
                'allowPaging': true,
                'business': 'GetFetchHiddenDangerStandardDetail',
                'data': '0df5ea1e-9886-4af2-9c2d-63c8fa08c772,1544b816-54f9-4c29-9d53-6d63f488d3d6',
                'pageIndex': 0,
                'pageSize': 0,
                'tokenId': this.userInfo.tokenId,
                'userId': this.userInfo.userid
            }
            this.$axiosAjax.getConfigJson(
                param
            ).then(
                (res) => {
                    this.theModel = res.data.data
                }
            )
        },
        tosavemsg () {
            if (this.userInfo.departsir !== '1') {
                if (!this.hiddenmeta.deptName) {
                    this.$vux.toast.text('请选择被检查单位')
                    return false
                }
            }
            if (!this.hiddenmeta.category) {
                this.$vux.toast.text('请选择隐患类别')
                return false
            } else if (!this.hiddenmeta.description) {
                this.$vux.toast.text('请选择或输入隐患描述')
                return false
            } else if (this.hiddenmeta.uploadImgs.length === 0 && this.userInfo.departsir === '1') {
                this.$vux.toast.text('请上传图片')
                return false
            } else if (!this.hiddenmeta.measure) {
                this.$vux.toast.text('请输入整改措施')
                return false
            } else if (!this.hiddenmeta.resolveStartTime) {
                this.$vux.toast.text('请选择整改开始时间')
                return false
            } else if (!this.hiddenmeta.resolveEndTime) {
                this.$vux.toast.text('请选择整改结束时间')
                return false
            } else if (!this.hiddenmeta.resolveAreaDutyPerson) {
                this.$vux.toast.text('请选择整改责任人')
                return false
            }
            let a = new Date()
            let arr = []
            this.newBlobList.forEach(
                (item) => {
                    arr = [...arr, item.name]
                }
            )
            let parrams = {
                'category': this.hiddenmeta.category, // 1
                'categoryId': this.hiddenmeta.categoryId, // 1
                'checkDeptCode': this.userInfo.deptcode, // d
                'checkDeptId': this.userInfo.deptid, // d
                'checkDeptName': this.userInfo.deptname, // d
                'checkPerson': this.userInfo.username, // d
                'checkPersonId': this.userInfo.userid, // d
                'checkTime': this.hiddenmeta.checkTime, // 1
                'checkWorkId': '', // 检测信息
                'deptId': this.hiddenmeta.deptId, // 所属项目ID
                'deptName': this.hiddenmeta.deptName, // 所属项目名称
                'description': this.hiddenmeta.description, // 隐患描述
                'hdLevel': this.hiddenmeta.hdLevel ? this.hiddenmeta.hdLevel[0] : '',
                'isApproved': false,
                'isBig': this.hiddenmeta.hdLevel[0] == '一般隐患' ? 0 : 1,
                'isChecked': false,
                'isResolved': false,
                'isSubmited': false,
                'localId': a.getTime(),
                'measure': this.hiddenmeta.measure,
                'measureEdit': false, //
                'no': '',
                'problemImgs': arr,
                // 'problemImgs': this.problemImgs,
                'projectDutyPerson': this.hiddenmeta.projectDutyPerson, // 项目负责人姓名||
                'registerUserId': this.userInfo.userid, // 登陆拿
                'resolveArea': this.hiddenmeta.resolveArea,
                'resolveAreaDutyPerson': this.hiddenmeta.resolveAreaDutyPerson,
                'resolveAreaDutyPersonId': this.hiddenmeta.resolveAreaDutyPersonId,
                'resolveEndTime': this.hiddenmeta.resolveEndTime,
                'resolveStartTime': this.hiddenmeta.resolveStartTime,
                'tel': this.userInfo.tel,
                'userId': this.userInfo.userid,
                'images': this.images,
                // 'uploadImgs': this.uploadImgs,
                'formData': this.uploadImgFormData,
                'newBlobList': this.newBlobList,

                'ResolveDeptName': this.hiddenmeta.ResolveDeptName, // 整改单位
                'ResolveDeptCode': this.hiddenmeta.ResolveDeptCode,
                'ResolveDutyPersonName': this.hiddenmeta.ResolveDutyPersonName,
                'ResolveDeptId': this.hiddenmeta.ResolveDeptId,
                'ResolveGroupId': this.hiddenmeta.ResolveGroupId,
                'ResolveGroup': this.hiddenmeta.ResolveGroup,
                'ResolveGroupDutyPerson': this.hiddenmeta.ResolveGroupDutyPerson,
                'flag1': this.hiddenmeta.flag1,
                'flag2': this.hiddenmeta.flag2,
                'flag3': this.hiddenmeta.flag3

            }
            let param = {
                'allowPaging': true,
                'business': 'RegisterHiddenCs',
                'data': parrams,
                'tokenId': this.userInfo.tokenId,
                'userId': this.userInfo.userid
            }
            this.$vux.loading.show({
                text: '加载中...'
            })
            let formData = Object.assign({}, this.hiddenmeta).formData
            this.$axiosAjax.getConfigJson(
                param,
                formData
            ).then(
                (res) => {
                    if (res.data.code == 0) {
                        this.hiddenmeta = this.backupHiddenmeta
                        this.uploadImgFormData = ''// 图片上传formData对象
                        this.uploadImgs = []
                        this.images = []
                        this.newBlobList = []
                        this.showUpload = false
                        this.$router.go(-1)
                    }
                }
            )
        },
        setFormData (formData, uploadLength, uploadImgs, images, newBlobList) {
            this.uploadLength = uploadLength
            this.uploadImgs = uploadImgs
            this.images = images
            this.newBlobList = newBlobList
            this.$store.state.images = this.images
            this.$store.state.uploadImgs = this.uploadImgs
            this.$store.state.formData = Object.assign({}, this.uploadImgFormData)
            this.hiddenmeta = Object.assign({}, this.hiddenmeta, {
                'images': this.images,
                'uploadImgs': this.$store.state.uploadImgs,
                'formData': formData,
                'newBlobList': newBlobList
            })
        },
        newchange (val) {
            this.hiddenmeta = Object.assign({}, this.hiddenmeta, {
                'resolveStartTime': val
            })
            this.showDateEnd = val
            this.hiddenmeta.resolveEndTime = ''
        },
        newchangeend (val) {
            this.hiddenmeta = Object.assign({}, this.hiddenmeta, {
                'resolveEndTime': val
            })
            this.$store.state.startEnd = this.startEnd
        },
        newchecktime (val) {
            this.hiddenmeta = Object.assign({}, this.hiddenmeta, {
                'checkTime': val
            })
        },
        changeleve (val) {
            this.hiddenmeta.hdLevel = val
            this.hiddenmeta = Object.assign({}, this.hiddenmeta, {
                'hdLevel': val
            })
        },
        hidenewfirst (val) {
            this.hiddenmeta = Object.assign({}, this.hiddenmeta, {
                'description': val
            })
        },
        changeResolveArea (val) {
            this.hiddenmeta = Object.assign({}, this.hiddenmeta, {
                'resolveArea': val
            })
        },
        resolveAreaKeyDown () {
            this.manualArea = true
            this.hiddenlist = Object.assign({}, this.hiddenlist, {
                'resolveAreaDutyPerson': '',
                'resolveAreaDutyPersonId': ''
            })
        },
        hidenewtwo (val) {
            this.hiddenmeta = Object.assign({}, this.hiddenmeta, {
                'measure': val
            })
        },
        getdatenew () {
            var date = new Date()
            var seperator1 = '-'
            var year = date.getFullYear()
            var month = date.getMonth() + 1
            var strDate = date.getDate()
            if (month >= 1 && month <= 9) {
                month = '0' + month
            }
            if (strDate >= 0 && strDate <= 9) {
                strDate = '0' + strDate
            }
            var currentdate = year + seperator1 + month + seperator1 + strDate
            return currentdate
        },
        selectHideType (item) {
            this.hideTypePropShow = false
            this.hiddenmeta = Object.assign({}, this.hiddenmeta, {
                'category': item.DeptName,
                'categoryId': item.DeptId
            })
        },
        async selectHideDesPerson (description, standardId) {
            this.hideDescribePropShow = false
            this.hiddenmeta = Object.assign({}, this.hiddenmeta, {
                'standardId': standardId,
                'description': description
            })
            if (standardId) {
                this.getStandardDetail()
            }
        },
        getStandardDetail () {
            let param = {
                'allowPaging': true,
                'business': 'GetFetchHiddenDangerStandardDetail',
                'data': this.hiddenmeta.standardId,
                'pageIndex': 0,
                'pageSize': 0,
                'tokenId': this.userInfo.tokenId,
                'userId': this.userInfo.userid
            }
            return this.$axiosAjax.getConfigJson(
                param
            ).then((res) => {
                if (res.data.code == 0) {
                    this.hiddenmeta = Object.assign({}, this.hiddenmeta, {
                        'measure': res.data.data.DeptDetail
                    })
                }
            }
            )
        },
        selectAreaFn (item) {
            this.selectAreaPropShow = false
            this.manualArea = false
            if (item.pName) {
                this.hiddenmeta = Object.assign({}, this.hiddenmeta, {
                    'resolveArea': item.name,
                    'resolveAreaDutyPerson': item.pName,
                    'resolveAreaDutyPersonId': item.pId
                })
            } else {
                this.hiddenmeta = Object.assign({}, this.hiddenmeta, {
                    'resolveArea': item.name,
                    'resolveAreaDutyPerson': item.pName,
                    'resolveAreaDutyPersonId': item.pId
                })
            }
        },
        selectCompanyFn (item) {
            this.changeCompanyPropShow = false
            this.hiddenmeta = Object.assign({}, this.hiddenmeta, {
                'ResolveDeptName': item.deptName, // 整改单位
                'ResolveDeptCode': item.deptCode,
                'ResolveDutyPersonName': item.DutyPerson,
                'ResolveDeptId': item.deptId,
                'ResolveGroupId': '',
                'ResolveGroup': '',
                'ResolveGroupDutyPerson': ''
            })
        },
        selectResponsibleUserFn (item) {
            this.zgResponsiblePropShow = false
            localStorage.positionper = JSON.stringify({
                name: '无', pName: item.PersonName
            })
            this.hiddenmeta = Object.assign({}, this.hiddenmeta, {
                'resolveAreaDutyPerson': item.PersonName, // 整改单位
                'resolveAreaDutyPersonId': item.PersonId
            })
        },
        selectTeamFn (item) {
            this.changeTeamPropShow = false
            this.hiddenmeta = Object.assign({}, this.hiddenmeta, {
                'ResolveGroupId': item.deptId,
                'ResolveGroup': item.deptName,
                'ResolveGroupDutyPerson': item.DutyPerson
            })
        },
        selectCompany (item) {
            this.companyPropShow = false
            this.checkcompany = item
            this.hiddenmeta = Object.assign({}, this.hiddenmeta, {
                'deptName': item.Name,
                'deptId': item.Id,
                'projectDutyPerson': item.DutyPerson
            })
        },
        lookcompanylist () { // 查看项目级公司信息
            let param = {
                'allowPaging': true,
                'business': 'getHdProjects',
                'data': this.userInfo.deptid,
                'pageIndex': 0,
                'pageSize': 20,
                'tokenId': this.userInfo.tokenId,
                'userId': this.userInfo.userid
            }
            this.$axiosAjax.getConfigJson(
                param
            ).then(
                (res) => {
                    if (res.data.code == 0) {
                        this.checkcompany = res.data.data[0]
                    }
                }
            )
        }
    }
}
</script>
<style lang="less" scoped>
.right-select {
    display: flex;
    justify-content: flex-end;
    font-size: 13px;
    color: #999;
    height: 20px;
    width: 180px;
    position: relative;
    // padding-right: 20px;
    line-height: 20px;
    display: flex;
    align-items: center;
}
.right-select p {
    width: 130px;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.right-select > i::before {
    color: #c8c8cd;
}
.btns .green {
    background: #15bc84;
}
.newcompanyList {
    font-size: 14px;
    text-align: right;
    color: #999;
}
.hide-register .icon-jinru:before {
    color: #c8c8cd;
}
</style>
